package com.hl.web.fore;

import com.hl.pojo.FeeStandards;
import com.hl.service.FeeStandardsService;
import com.hl.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/feeStandards")
public class FeeStandardsController {
    @Autowired
    private FeeStandardsService feeStandardsService;

    @PostMapping("/add")
    public ResultEntity add(@RequestBody FeeStandards feeStandards) {
        return ResultEntity.ok(feeStandardsService.add(feeStandards));
    }

    @GetMapping("/findAll")
    public ResultEntity findAll(){
        return ResultEntity.ok(feeStandardsService.findAll());
    }
    @GetMapping("/findById")
    public ResultEntity findById(String id){
        return ResultEntity.ok(feeStandardsService.findById(id));
    }
    @GetMapping("/findByConsultationMethods")
    public ResultEntity findByConsultationMethods(String consultationMethods){
        return ResultEntity.ok(feeStandardsService.findByConsultationMethods(consultationMethods));
        }

    @GetMapping("/findByConsultantId")
    public ResultEntity findByConsultantId(Integer consultantId){
        return ResultEntity.ok(this.feeStandardsService.findByConsultantId(consultantId));
    }

    @GetMapping("/del")
    public ResultEntity delete(String id){
        return ResultEntity.ok(feeStandardsService.delete(id));
    }
    @PostMapping("/update")
    public ResultEntity update(@RequestBody FeeStandards feeStandards){
        return ResultEntity.ok(feeStandardsService.update(feeStandards));
    }
}
